<template>
  <el-card class="box-card user-center-info" shadow="hover">
    <div slot="header">
      <div class="tag">个人中心</div>
      <el-button
        style="float: right; padding: 3px 0"
        type="text"
        class="btn_more"
        @click="openPersonalCenter"
      >更多</el-button>
    </div>
    <p class="text_size_8 text_color_666">用户名：{{userInfo.name}}</p>
    <p class="text_size_8 text_color_666">获得学分：{{userInfo.credits}}</p>
    <p class="text_size_8 text_color_666">单位排名：{{userInfo.unitRanking}}</p>
    <p class="text_size_8 text_color_666">全校排名：{{userInfo.collegeRanking}}</p>
    <p class="text_size_8 text_color_666">累计完成学时：{{userInfo.cumulativeHours}}小时</p>
    <p class="text_size_8 text_color_666">考试次数：{{userInfo.examsCount}}次</p>
    <!-- <p class="text_size_8 text_color_666">
      待处理公文数：
      <span class="text_color_429688">{{userInfo.waitWorkCount}}</span>
    </p>-->
<!--    <p class="text_size_8 text_color_666">
      待办事项：
      <span class="text_color_429688 todo" @click="goToDo">{{userInfo.todoCount}}</span>
    </p>-->
  </el-card>
</template>
<script>
export default {
  name: 'UserCenterInfo',
  computed: {
    userInfo() {
      return this.$store.state.userInfo
    }
  },
  methods: {
    openPersonalCenter() {
      const activeMenu = this.$store.state.activeMenu
      if (utils.checkStartExam()) {
        if (activeMenu === '/LearningHome/OnlineExams') {
          this.$notify.error('正在考试中')
        }
        return
      }
      this.$router.push('/LearningHome/PersonalCenter')
    },
    goToDo() {
      this.$router.push('/LearningHome/PersonalCenter?tabName=second')
    }
  }
}
</script>
<style lang="less">
.xd-learn .user-center-info .el-card__body {
  p {
    margin-bottom: 10px;
    &:last-child {
      margin-bottom: 0px;
    }
  }
  .todo {
    cursor: pointer;
  }
}
</style>
